package cc.vv.btpartyjob.partymanager.delegate

import android.view.View
import android.widget.RelativeLayout
import cc.vv.btpartyjob.partymanager.R
import cc.vv.btpartyjob.partymanager.inter.OperationItemClickInterface
import cc.vv.btpartyjob.partymanager.moudel.bean.OperationBean
import cc.vv.btpartyjob.partymanager.view.OperationView
import cc.vv.mvp.delegate.BaseAppDelegate
import java.util.*

/**
 * 党务管理托管类
 * Created by Chen.qi on 2018/10/24.
 */
class PartyManagerMainFragmentDelegate : BaseAppDelegate() {

    override fun initWidget() {

    }

    override fun initLayoutRes(): Int {
        return R.layout.fragment_partymanager_main
    }


    /**
     * 设置社区大党委数据
     */
    fun setSheQuDangWeiData(optionList: ArrayList<OperationBean>, itemClickCallBack: OperationItemClickInterface?) {
        getView<OperationView>(R.id.ov_fpm_sheQuDangWei)?.addAllSelectedFileView(optionList, 4, itemClickCallBack)
    }

    /**
     * 设置双报到，双承诺，双服务，双数据
     */
    fun setDoubleServerAndData(optionList: ArrayList<OperationBean>, itemClickCallBack: OperationItemClickInterface?) {
        getView<OperationView>(R.id.ov_fpm_doubleServer)?.addAllSelectedFileView(optionList, 4, itemClickCallBack)

    }

    /**
     * 街道联席会议
     */
    fun setStreetMeetingData(optionList: ArrayList<OperationBean>, itemClickCallBack: OperationItemClickInterface?) {
        getView<OperationView>(R.id.ov_fpm_streetMeeting)?.addAllSelectedFileView(optionList, 4, itemClickCallBack)
    }

    /**
     * 项目管理是否显示
     */
    fun isShowProjectManager(isShow: Boolean) {
        val view = getView<RelativeLayout>(R.id.rl_fpm_projectManager)
        if (isShow) {
            view?.visibility = View.VISIBLE
        } else {
            view?.visibility = View.GONE
        }
    }

    /**
     * 项目管理
     */
    fun setProjectManagerData(optionList: ArrayList<OperationBean>, itemClickCallBack: OperationItemClickInterface?) {
        getView<OperationView>(R.id.ov_fpm_projectManager)?.addAllSelectedFileView(optionList, 4, itemClickCallBack)
    }

    /**
     * 非公党建
     */
    fun setNoPublicPartyData(optionList: ArrayList<OperationBean>, itemClickCallBack: OperationItemClickInterface?) {
        getView<OperationView>(R.id.ov_fpm_noPublicParty)?.addAllSelectedFileView(optionList, 4, itemClickCallBack)
    }


    /**
     * 脱贫攻坚是否显示
     */
    fun isShowTuoPingGongJian(isShow: Boolean) {
        val view = getView<RelativeLayout>(R.id.rl_fpm_tuoPingGongJian)
        if (isShow) {
            view?.visibility = View.VISIBLE
        } else {
            view?.visibility = View.GONE
        }
    }

    /**
     * 脱贫攻坚
     */
    fun setPovertyAlleviationData(optionList: ArrayList<OperationBean>, itemClickCallBack: OperationItemClickInterface?) {
        getView<OperationView>(R.id.ov_fpm_povertyAlleviation)?.addAllSelectedFileView(optionList, 4, itemClickCallBack)
    }


    /**
     * 数据支撑是否显示
     */
    fun isShowDataSupport(isShow: Boolean) {
        val view = getView<RelativeLayout>(R.id.rl_fpm_dataSupport)
        if (isShow) {
            view?.visibility = View.VISIBLE
        } else {
            view?.visibility = View.GONE
        }
    }

    /**
     * 数据支撑
     */
    fun setDataSupportData(optionList: ArrayList<OperationBean>, itemClickCallBack: OperationItemClickInterface?) {
        getView<OperationView>(R.id.ov_fpm_dataSupport)?.addAllSelectedFileView(optionList, 4, itemClickCallBack)

    }

}